package org.loneranger.p2_bean_post_processor;

import org.loneranger.p2_bean_post_processor.bean.UserService;
import org.loneranger.p2_bean_post_processor.config.Config;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * bean的生命周期：初始化前后
 */
public class BeanLifeCycleTest {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(Config.class);
        UserService userService = applicationContext.getBean("userService", UserService.class);
        userService.sayMyName();

    }
}
